using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace XiaoMan.Model.Models.Mapping
{
    public class Forum_PicturesMap : EntityTypeConfiguration<Forum_Pictures>
    {
        public Forum_PicturesMap()
        {
            // Primary Key
            this.HasKey(t => t.PicID);

            // Properties
            this.Property(t => t.PicFileName)
                .HasMaxLength(100);

            this.Property(t => t.PicFileNameThumbnail)
                .HasMaxLength(100);

            // Table & Column Mappings
            this.ToTable("Forum_Pictures");
            this.Property(t => t.PicID).HasColumnName("PicID");
            this.Property(t => t.TopicID).HasColumnName("TopicID");
            this.Property(t => t.PicFileName).HasColumnName("PicFileName");
            this.Property(t => t.PicFileNameThumbnail).HasColumnName("PicFileNameThumbnail");

            // Relationships
            //this.HasOptional(t => t.Forum_Topic)
            //    .WithMany(t => t.Forum_Pictures)
            //    .HasForeignKey(d => d.TopicID);

        }
    }
}
